Function: cloneNodes(domElement, boolOnlyReturnNode) Description: Copies all DOM nodes within an element and returns them as a DOM fragment or element node. Returns: domFragment, domElement, or $A object if chained. Note: The cloneNodes() function will return a document fragment by default, which may include multiple elements at the same logical level. However, when boolOnlyReturnNode is set to true, a standard DOM node will be returned instead. When this occurs, only the first top level container element is returned, and all others at the same logical level are ignored. The cloned DOM node may contain any number of additional elements though, with no restriction. Example: // Copy the contents of a DOM element and return a document fragment var myNodes = $A.cloneNodes(domElement); // Copy the contents of a DOM element and return a DOM element node var myNode = $A.cloneNodes(domElement, true); // Or the same using chaining // Copy the contents of a DOM element and return a document fragment var myChain = $A(domElement).cloneNodes(); // Copy the contents of a DOM element and return a DOM element node var myChain = $A(domElement).cloneNodes(true); // To return the modified element within a chain, use the "return()" method. var myElement = myChain.return();